<include file="public/layout" />
<style>
    .system_img_location{text-align: center; width: 120px;position:absolute;top:15px; margin-left:265px;}
</style>
<!--以下是在线编辑器 代码 -->
<load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js"/>
<load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js"/>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js"></script>
<!--以上是在线编辑器 代码  end-->
<body style="background-color: #FFF; overflow: auto;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>公司简介</h3>
                <h5>公司基本信息设置</h5>
            </div>
            <ul class="tab-base nc-row">
                <foreach name="group_list" item="v" key="k">
                    <li><a href="{:U('System/index',['inc_type'=> $k])}" <if condition="$k==$inc_type">class="current"</if>><span>{$v}</span></a></li>
                </foreach>
            </ul>
        </div>
    </div>
    <!-- 操作说明 -->
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span> </div>
        <ul>
            <li>该页面的所有默认图标"网站根目录/public/static/images/logo"目录下, 如果需要重新设计图标可参考默认图</li>
            <li>鼠标移到图标LOGO右侧 <a title="图片所在位置" class="pic-thumb-tip" ><i class="fa fa-picture-o"></i></a>会显示该图片大概所在位置</li>
        </ul>
    </div>
    <div id="ajaxwaitid"></div>
    <form method="post" id="handlepost" action="{:U('Store/infosave')}" name="form1">
        <input type="hidden" name="form_submit" value="ok" />
        <input id="store_id" name="store_id" value="{$info.store_id}" type="hidden" />
        <div class="ncap-form-default">
        	<dl class="row">
                <dt class="tit">
                    <label for="record_no">店铺编号</label>
                </dt>
                <dd class="opt">
                    <input value="00{$info.store_id*66 + 12}" class="input-txt" disabled="disabled"  type="text" />
                    <p class="notic">店铺编号,可用在查询小程序</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="record_no">店铺名称</label>
                </dt>
                <dd class="opt">
                    <input id="name" name="name" value="{$info.name}" class="input-txt" type="text" />
                    <p class="notic">显示在前台的店铺名称</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="store_name">店铺地址</label>
                </dt>
                <dd class="opt">
                    <input id="address" name="address" value="{$info.address}" class="input-txt" type="text" />
                    <p class="notic">显示在前台的店铺地址</p>
                </dd>
            </dl>
            
            <dl class="row">
                <dt class="tit">
                    <label for="store_name">联系电话</label>
                </dt>
                <dd class="opt">
                    <input id="phone" name="phone" value="{$info.phone}" class="input-txt" type="text" />
                    <p class="notic">联系电话 如果需要些多个请用  , 号隔开 如136xxx,135xxx</p>
                </dd>
            </dl>
            
            <!--<dl class="row">
                <dt class="tit">
                    <label for="store_email">邮箱</label>
                </dt>
                <dd class="opt">
                    <input id="email" name="email" value="{$info.email}" class="input-txt" type="text" />
                    <p class="notic">请填写正确的邮箱格式</p>
                </dd>
            </dl>-->
            
            <dl class="row">
                <dt class="tit">
                    <label for="store_name">公司介绍</label>
                </dt>
                <dd class="opt">
                    <textarea rows="5" cols="80" name="message" class="input-txt" style="height: 80px;">{$info.message}</textarea>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="store_logo">公司简介图片</label>
                </dt>
                <dd class="opt">
                    <div class="input-file-show">
                        <span class="show">
                            <a id="icon_a" target="_blank" class="nyroModal" rel="gal" href="{$info.icon|default='/public/static/images/logo/pc_home_logo_default.png'}">
                                <i id="icon_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src='+localUrl+'{$info.icon|default=\'/public/static/images/logo/pc_home_logo_default.png\'}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
                            </a>
                        </span>
           	            <span class="type-file-box">
                            <input type="text" id="icon" name="icon" value="{$info.icon|default='/public/static/images/logo/pc_home_logo_default.png'}" class="type-file-text">
                            <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
                            <input class="type-file-file" onClick="GetUploadify(1,'icon','logo','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                        </span>
                    </div>
                    <div class="system_img_location">
                        <!--<a title="图片所在位置" href="__PUBLIC__/static/images/logo/pc_home_logo_pos.png" class="pic-thumb-tip" onmouseover="layer.tips('<img src=__PUBLIC__/static/images/logo/pc_home_logo_pos.png>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"><i class="fa fa-picture-o"></i></a>-->
                    </div>
                    <span class="err"></span>
                    <p class="notic">通用头部显示，最佳显示尺寸为2:1 最大不能够超过2M</p>
                </dd>
            </dl>
            
            
            <dl class="row">
                <dt class="tit">
                    <label for="store_logo">微信分享loge</label>
                </dt>
                <dd class="opt">
                    <div class="input-file-show">
                        <span class="show">
                            <a id="shareicon_a" target="_blank" class="nyroModal" rel="gal" href="{$info.shareicon|default='/public/static/images/logo/pc_home_logo_default.png'}">
                                <i id="shareicon_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src='+localUrl+'{$info.shareicon|default=\'/public/static/images/logo/pc_home_logo_default.png\'}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
                            </a>
                        </span>
           	            <span class="type-file-box">
                            <input type="text" id="shareicon" name="shareicon" value="{$info.shareicon|default='/public/static/images/logo/pc_home_logo_default.png'}" class="type-file-text">
                            <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
                            <input class="type-file-file" onClick="GetUploadify(1,'shareicon','logo','img_call_back','',32*1024)" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                        </span>
                    </div>
                    <div class="system_img_location">
                        <!--<a title="图片所在位置" href="__PUBLIC__/static/images/logo/pc_home_logo_pos.png" class="pic-thumb-tip" onmouseover="layer.tips('<img src=__PUBLIC__/static/images/logo/pc_home_logo_pos.png>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"><i class="fa fa-picture-o"></i></a>-->
                    </div>
                    <span class="err"></span>
                    <p class="notic">通用h5分享图片，最佳显示尺寸为1:1,最大不能够超过32kb</p>
                </dd>
            </dl>
            
            
            <dl class="row">
                <dt class="tit">
                    <label for="store_user_logo">小程序二维码</label>
                </dt>
                <dd class="opt">
                    <div class="input-file-show">
                        <span class="show">
                            <a id="qrcode_a" class="nyroModal" rel="gal" href="{$info.qrcode|default='/public/static/images/logo/pc_home_user_logo_default.png'}">
                                <i id="qrcode_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src='+localUrl+'{$info.qrcode|default=\'/public/static/images/logo/pc_home_user_logo_default.png\'}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
                            </a>
                        </span>
           	            <span class="type-file-box">
                            <input type="text" id="qrcode" name="qrcode" value="{$info.qrcode|default='/public/static/images/logo/pc_home_user_logo_default.png'}" class="type-file-text">
                            <input type="button" name="button" value="生成二维码" class="type-file-button">
                            <input class="type-file-file" onClick="createQr()" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                        </span>
                    </div>
                    <div class="system_img_location">
                    </div>
                    <span class="err"></span>
                    <p class="notic">点击按钮生成小程序二维码</p>
                </dd>
            </dl>
            
            <dl class="row">
                <dt class="tit">
                    <label for="store_name">网站地址</label>
                </dt>
                <dd class="opt">
                    <input id="email" name="email"  class="input-txt" value="{$info.tourl}" type="text" />
                </dd>
            </dl>
            
            <dl class="row">
                <dt class="tit">
                    <label for="record_no">商品详情描述</label>
                </dt>
                <dd class="opt">                    
                    <textarea class="span12 ckeditor" id="htmlmsg" name="htmlmsg" title="">{$info.htmlmsg}</textarea>
                    <span class="err" id="err_htmlmsg" style="color:#F00; display:none;"></span>                    
                </dd>
            </dl>  
            <div class="bot">
                <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="storesave()">确认提交</a>
            </div>
        </div>
    </form>
</div>
<div id="goTop"> <a href="JavaScript:void(0);" id="btntop"><i class="fa fa-angle-up"></i></a><a href="JavaScript:void(0);" id="btnbottom"><i class="fa fa-angle-down"></i></a></div>
</body>
<script type="text/javascript">
	
	var url="{:url('Admin/Ueditor/index',array('savePath'=>'store'))}";
	var ue = UE.getEditor('htmlmsg',{
	     serverUrl :url,
	     zIndex: 999,
	     initialFrameWidth: "100%", //初化宽度
	     initialFrameHeight: 300, //初化高度            
	     focus: false, //初始化时，是否让编辑器获得焦点true或false
	     maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
	     pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
	     autoHeightEnabled: true
	});
     
	function storesave(){
        $('span.err').hide();
        $.ajax({
            type: "POST",
            url: "{:U('Store/infosave')}",
            data: $('#handlepost').serialize(),
            async:false,
            dataType: "json",
            error: function () {
                layer.alert("服务器繁忙, 请联系管理员!");
            },
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg, {
                        icon: 1,
                        time: 2000
                    });
                } else {
                    layer.msg(data.msg, {icon: 2,time: 3000});
                }
            }
        });
    
	}
	
	//创建二维码
	function createQr(){
        $.ajax({
            type: "POST",
            url: "{:U('Store/createQr')}",
            data: {},
            async:false,
            dataType: "json",
            error: function () {
                layer.alert("服务器繁忙, 请联系管理员!");
            },
            success: function (data) {
                if (data.status == 1) {
                	layer.msg(data.msg, 
                		{icon: 1, time: 800},function(){
                        location.href = location.href;
                   });	                               
                } else {
                    layer.msg(data.msg, {icon: 2,time: 3000});
                }
            }
        });
	}
	
	
    //网站图标
    function img_call_back(fileurl_tmp , elementid)
    {
      	console.log('fileurl_tmp='+fileurl_tmp);
        var shourl = localUrl + fileurl_tmp;
        $("#"+elementid).val(fileurl_tmp);
        $("#"+elementid+'_a').attr('href', shourl);
        $("#"+elementid+'_i').attr('onmouseover', "layer.tips('<img src="+shourl+">',this,{tips: [1, '#fff']});");
    }
    //网站用户中心logo
    function user_img_call_back(fileurl_tmp)
    {
    	console.log('fileurl_tmp1='+fileurl_tmp);
        $("#store_user_logo").val(fileurl_tmp);
        $("#userimg_a").attr('href', fileurl_tmp);
        $("#userimg_i").attr('onmouseover', "layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
    }
    //网站图标
    function store_ico_call_back(fileurl_tmp)
    {
    	console.log('fileurl_tmp2='+fileurl_tmp);
        $("#store_ico").val(fileurl_tmp);
        $("#storeico_a").attr('href', fileurl_tmp);
        $("#storeico_i").attr('onmouseover', "layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
    }
   
</script>
</html>